package com.example.demo.controller;

import com.example.demo.service.BoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class BoardController {
    @Autowired
    BoardService boardService;

    @GetMapping("/problem")
    public String getNewBoard() {
        return boardService.getNewBoard();
    }

    @GetMapping("/answer")
    public String[] getAnswer(@RequestParam String problem) {
        return boardService.getAnswer(problem);
    }
}
